import urllib.request


def create_proxy_handler():
    url = "https://blog.csdn.net/qq_38200548/article/details/80643394"

    # 添加代理
    proxy = {
        # 免费的写法
        "http":"http://117.184.67.118:8060",
        # 付费代理
        # "http":"xiaoming":123  账号密码登录
    }

    # 代理处理器
    proxy_handler = urllib.request.ProxyHandler(proxy)
    # 创建opener
    opener = urllib.request.build_opener(proxy_handler)
    # 拿着代理ip发送请求
    data = opener.open(url).read()
    print(data)

create_proxy_handler()